﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using PMC.Urls;

namespace PMCgui
{
    public class MainPanel : TransitionUserControl
    {
        private Button btnCheckMail;
        private Button btnUpgrade;
        private Button btnTranslations;
        private PMC.Wbrowser reference;

        public MainPanel()
        {
            InitializeComponent();
        }

        private void InitializeComponent()
        {
            this.btnUpgrade = new System.Windows.Forms.Button();
            this.btnTranslations = new System.Windows.Forms.Button();
            this.btnCheckMail = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // btnUpgrade
            // 
            this.btnUpgrade.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnUpgrade.Image = global::PMCgui.Properties.Resources.upgrade1;
            this.btnUpgrade.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
            this.btnUpgrade.Location = new System.Drawing.Point(3, 3);
            this.btnUpgrade.Name = "btnUpgrade";
            this.btnUpgrade.Padding = new System.Windows.Forms.Padding(10, 10, 2, 10);
            this.btnUpgrade.Size = new System.Drawing.Size(109, 60);
            this.btnUpgrade.TabIndex = 0;
            this.btnUpgrade.Text = Language.Instance.Upgrade;
            this.btnUpgrade.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnUpgrade.UseVisualStyleBackColor = true;
            this.btnUpgrade.Click += new System.EventHandler(this.btnUpgrade_Click);
            // 
            // btnTranslations
            // 
            this.btnTranslations.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnTranslations.Image = global::PMCgui.Properties.Resources.earthicon;
            this.btnTranslations.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
            this.btnTranslations.Location = new System.Drawing.Point(233, 3);
            this.btnTranslations.Name = "btnTranslations";
            this.btnTranslations.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
            this.btnTranslations.Size = new System.Drawing.Size(109, 60);
            this.btnTranslations.TabIndex = 1;
            this.btnTranslations.Text = Language.Instance.strLanguage;
            this.btnTranslations.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnTranslations.UseVisualStyleBackColor = true;
            this.btnTranslations.Click += new EventHandler(btnTranslations_Click);

            // 
            // btnCheckMail
            // 
            this.btnCheckMail.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.btnCheckMail.Image = global::PMCgui.Properties.Resources.MailButton;
            this.btnCheckMail.ImageAlign = System.Drawing.ContentAlignment.TopLeft;
            this.btnCheckMail.Location = new System.Drawing.Point(118, 3);
            this.btnCheckMail.Name = "btnCheckMail";
            this.btnCheckMail.Padding = new System.Windows.Forms.Padding(10, 10, 2, 10);
            this.btnCheckMail.Size = new System.Drawing.Size(109, 60);
            this.btnCheckMail.TabIndex = 1;
            this.btnCheckMail.Text = Language.Instance.Mail;
            this.btnCheckMail.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            this.btnCheckMail.UseVisualStyleBackColor = true;
            this.btnCheckMail.Click += new System.EventHandler(this.btnCheckMail_Click);
            // 
            // MainPanel
            // 
            this.Controls.Add(this.btnUpgrade);
            this.Controls.Add(this.btnTranslations);
            this.Controls.Add(this.btnCheckMail);
            this.Name = "MainPanel";
            this.Size = new System.Drawing.Size(385, 70);
            this.ResumeLayout(false);

        }

        void btnTranslations_Click(object sender, EventArgs e)
        {
            Transition(new LanguageUserControl(), Panel.Main);
        }

        private void btnCheckMail_Click(object sender, EventArgs e)
        {
            var b = ProgressControl.Instance;
            Transition(new WebbrowserMenustrip(), Panel.Menu);
            Transition(b, Panel.Main);
        }

        private void btnUpgrade_Click(object sender, EventArgs e)
        {
            Transition(new upgradeUsercontrol(), Panel.Main);
        }
    }
}
